package com.wukang.photovoltaicinspectionpictures.ui.photograph

import android.view.LayoutInflater
import android.view.ViewGroup
import com.wukang.photovoltaicinspectionpictures.base.BaseFragment
import com.wukang.photovoltaicinspectionpictures.databinding.FragmentShowPhotographBinding
import com.wukang.photovoltaicinspectionpictures.utils.onDebounceClick


/**
 * 展示照片页
 * @author wukang
 */
class ShowPhotographFragment : BaseFragment<FragmentShowPhotographBinding>() {

    companion object {
        val instance by lazy(LazyThreadSafetyMode.NONE) {
            ShowPhotographFragment()
        }
    }

    override fun initViewBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentShowPhotographBinding {
        return FragmentShowPhotographBinding.inflate(inflater, container, false)
    }

    override fun initFragment() {

    }

    override fun FragmentShowPhotographBinding.initView() {
        ivOpen.onDebounceClick {
            getParentActivity<TakePhotographActivity>().mModel.startShooting(true)
        }
        ivClose.onDebounceClick {
            getParentActivity<TakePhotographActivity>().mModel.startShooting(false)
        }
        btTakePhotograph.onDebounceClick {
            getParentActivity<TakePhotographActivity>().mModel.sendPhotograph()
        }
    }


}